import {Icon} from 'antd'
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

export default class Main extends React.Component{
	constructor(props){
		super(props);
	}
	
	
	render(){
		const {icon = '',
			//iconBackground = '#0079DE',
            showChange = true,
			itemWidth,
			isClick = false,
			showNumTitle=false,
			title = '',
			num = '',
			suffix = getLabel(386746,'对比上一年同期'),
			isUp = 2,
			type = 'finish',
			percent = ''
		} = this.props;

		const iconBackground = (type === 'finish') ? "#BEC647" : ((type === 'going') ? "#B47DF8":"#3cC8D2")
		const numClassName = isClick ? "num-click" : '';
		const numtitle = showNumTitle ? num : (isClick ? getLabel(386745,'点击查看流程清单'):'');

		return (
			<div className="c-item" style={{width:itemWidth}}>
				<div className="c-item-icon">
					<div className="c-item-icon-circle-base" style={{"background": iconBackground}}>
						<i className={icon}/>
					</div>
				</div>
				<div className="c-item-info">
					<ul>
						
						<li className={`item-info-num item-info-num-${type}`}>
							{/* <span title={numtitle} className={`${numClassName} num-format`} onClick={this.openListModal.bind(this)}>{num}</span> */}
							<span  className={`${numClassName} num-format`} >{num}</span>
						</li>
						<li className= {`item-info-title item-info-title-${type}`}>{title}</li>
						{/* {showChange &&
							<li>
								<div>
									{isUp === 1 && <Icon type="caret-up" style={iconStyle}/> }
									{isUp === 0 && <Icon type="caret-down" style={iconStyle}/>}
									<span style={iconStyle}>{percent}</span>
									<span style={{"color":"#868686"}}>{suffix}</span>
								</div>
							</li>
						} */}
					</ul>
				</div>
			</div>
			
		)
	}
	
	openListModal(){
		const {isClick=false,setListModalVisible,clickPara,showDetailModal} = this.props;
		if(isClick){
			typeof setListModalVisible === 'function' && setListModalVisible(true,{},clickPara);
			typeof showDetailModal === 'function' && showDetailModal(3,clickPara);
		}
	}
}
